package org.bellusoft.xbeam.framework;

import java.util.HashMap;
import java.util.Map;
import org.bellusoft.xbeam.contract.concurrent.ConditionalThreadsafe;
import org.bellusoft.xbeam.contract.concurrent.GuardedExternal;
import org.osgi.framework.launch.Framework;
import org.osgi.framework.launch.FrameworkFactory;

@ConditionalThreadsafe
public class FrameworkFactoryImpl implements FrameworkFactory{

	public Framework newFramework(@GuardedExternal Map<String, String> configuration) throws FrameworkConfigException {
		Map<String, String> copyedConf = new HashMap<String, String>(configuration.size());
		copyedConf.putAll(configuration);
		FrameworkConfig frameworkConfig = FrameworkConfig.instance(copyedConf);
		return new FrameworkImpl(frameworkConfig);
	}

}
